
 
 D C . r e m o v e ( o p t i o n a l C a l l b a c k F u n c t i o n ) 
 
 
 
 D e s c r i p t i o n :   R e m o v e s   a l l   r e n d e r e d   e l e m e n t s   a n d   e x i c u t e s   r e l e v a n t   l i f e c y c l e   m e t h o d s   o n   t h e   D C   o b j e c t . 
 
 
 
 R e t u r n s :   D C   O b j e c t . 
 
 
 
 N o t e :   W h e n   D C . a n i m a t e . o n R e m o v e   i s   s e t   t o   a   v a l i d   f u n c t i o n ,   i t   w i l l   a p p l y   r e l a t e d   v i s u a l   e f f e c t s   b e f o r e   t h e   p r o c e s s   o f   r e m o v a l   c o m p l e t e s .   A n   o p t i o n a l   f u n c t i o n   c a n   b e   p a s s e d   a s   t h e   f i r s t   p a r a m e t e r   t o   e x e c u t e   a   t e m p o r a r y   o n e - t i m e   c a l l b a c k   a f t e r   t h e   r e m o v a l   p r o c e s s   c o m p l e t e s . 
 
 
 
 E x a m p l e : 
 
 
 
 / /   O p t i o n a l l y   a p p l y   a   v i s u a l   a n i m a t i o n   e f f e c t   b e f o r e   t h e   D C   o b j e c t   i s   c l o s e d . 
 
 D C . a n i m a t e . o n R e m o v e   =   f u n c t i o n ( D C ,   w r a p p e r ,   n e x t )   { 
 
     / /   T o   e n s u r e   a c c e s s i b i l i t y ,   m a k e   s u r e   t h a t   t h e   n e x t ( )   f u n c t i o n   i s   e x e c u t e d   w i t h i n   t h e   c a l l b a c k   a f t e r   t h e   a n i m a t i o n   f i n i s h e s . 
 
     n e x t ( ) ; 
 
 } ; 
 
 
 
 / /   C l o s e   t h e   D C   o b j e c t   a n d   r e m o v e   a l l   r e n d e r e d   c o n t e n t . 
 
 D C . r e m o v e ( ) ; 
 
 
 
 / /   R e m o v e   t h e   D C   o b j e c t   c o n t e n t   a n d   e x e c u t e   a   o n e - t i m e   c a l l b a c k . 
 
 D C . r e m o v e ( f u n c t i o n ( )   { 
 
     / /   D o   s t u f f . 
 
     a l e r t ( D C . i d ) ; 
 
 } ) ; 
 
 